﻿using System;
using System.Globalization;

class DaysBetweenTwoDates
{
    static void Main()
    {
        //Exercise 16.
        //Write a program that reads two dates in the format: day.month.year and calculates the number of days between them. Example:
        //Enter the first date: 27.02.2006
        //Enter the second date: 3.03.2004
        //Distance: 4 days

        string firstDate = "27.02.2006";
        string secondDate = "3.03.2006";
        string format = "d.MM.yyyy";
        DateTime parsedFirstDate = DateTime.ParseExact(firstDate, format, CultureInfo.InvariantCulture);
        DateTime parsedSecondDate = DateTime.ParseExact(secondDate, format, CultureInfo.InvariantCulture);

        int distance = (int)Math.Abs((parsedSecondDate - parsedFirstDate).TotalDays);
        Console.WriteLine(distance + " days");
    }
}

